package io.github.talelin.latticy.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.github.talelin.latticy.common.mybatis.Page;
import io.github.talelin.latticy.dto.SpuDetailDTO;
import io.github.talelin.latticy.model.Spu;
import io.github.talelin.latticy.mapper.SpuMapper;
import io.github.talelin.latticy.service.SpuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * spu业务层
 *
 * @author YiHua
 * @since 2022-01-04
 */
@Service
public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements SpuService {

//    @Autowired
//    private SpuMapper spuMapper;

    @Override
    public IPage<Spu> paging(Integer pageNum, Integer pageSize) {
        Page<Spu> page = new Page<>(pageNum, pageSize);
        return this.getBaseMapper().selectPage(page, null);
    }

    @Override
    public SpuDetailDTO getSpuDetail(Integer id) {

        this.getBaseMapper().getSpuDetail(id);
        return null;
    }
}
